<!DOCTYPE html>
<html lang="en">
<head xmlns:th="http://www.thymeleaf.org">
    <meta charset="UTF-8">
    <title>学生信息管理</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/plugins/bootstraptable/bootstrap-table.min.css">
</head>
<body>
    <div class="container-fluid">

        <form class="form-inline">
            <div class="form-group">
                <label for="searchName">查询</label>
                <input type="text" class="form-control" id="searchName" placeholder="请输入名字" name="searchName">
            </div>
            <button type="button" class="btn btn-default btn-primary btn-lg" onclick="search();">查询</button>
            <button type="button" class="btn btn-default btn-primary btn-lg" data-toggle="modal" data-target="#myModal" onclick="preAdd();">
                新增学生
            </button>
        </form>

        <table class="table table-striped" id="stuTable">

        </table>
    </div>

    <div class="modal fade" tabindex="-1" role="dialog" id="myModal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">学生信息</h4>
                </div>
                <div class="modal-body">

                    <form id="formStudent">

                        <input hidden="hidden" id="id" name="id"/>
                        <div class="form-group">
                            <label for="name">姓名</label>
                            <input type="text" class="form-control" id="name" name="name" placeholder="姓名">
                        </div>
                        <div class="form-group">
                            <label for="password">密码</label>
                            <input type="password" class="form-control" id="password" name="password" placeholder="密码">
                        </div>
                        <div class="form-group">
                            <label for="sex">性别</label>
                            <select class="form-control" id="sex" name="sex">
                                <option value="1">男</option>
                                <option value="2">女</option>
                                <option value="0">未知</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="score">成绩</label>
                            <input type="text" class="form-control" id="score" name="score" placeholder="成绩">
                        </div>
                    </form>
                    <!--表单结束-->
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" onclick="saveStudent()">保存</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->


    <script src="/js/jquery-3.5.1.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/plugins/bootstraptable/bootstrap-table.min.js"></script>
    <script src="/plugins/bootstraptable/locale/bootstrap-table-zh-CN.js"></script>
    <script src="/js/getAll.js"></script>
</body>
</html>